/**
 * Version No. of RESTFull Services
 */
global.RESTFullServiceVersion = 'v1.0';

/**
 * Use the basic authentication way or not?
 * The authentication information to be put in http header
 */
global.BasicAuthen = 'No';

/**
 * Use MySQL or not
 */
global.MySQLFlag = 'No';

/**
 * app_key
 */
global.App_key = 'e57d1f86535a9f3307ba7e869687e14f';

/**
 * 是否需要启用cache
 */
global.enableCache = 'redis';

/**
 * 是否需要md5验证
 */
global.enbaleMd5 = 'No';
/**
 * 是否要把每个请求存入redis
 */
global.enableSaveRequest = 'Yes';

/**
 * 是否需要对每个请求进行audit
 */
global.enableAuditRequest = 'Yes';

/**
 * 是否根据服务器的kernel其中多个node进程
 */
global.enableMultiProcessor = 'No';

/**
 * 是否启用token
 */
global.enableToken = 'Yes';

/**
 * 验证码的过期时间, 默认300秒
 */
global.verificationCodeExpiredSeconds = 600;


/**
 * 提供给前端的list中每页的记录大小, 默认为20
 */
global.listPageSize = 20;
global.userTokenExpireSeconds = 30*24*60*60;
global.userDataCacheByTokenExpireSeconds = 30*24*60*60;

/**
 * 高亮颜色
 */
global.hlColor = 'F7744A';
global.noUserErrMessage = '登录已过期，请重新登录';

/**
 * 开发环境
 */
global.RabbitMqHostIp = 'localhost';
global.RedisHostIp = 'localhost';
global.MongoDBHostIp = 'localhost';
global.FastDfsHostIp = 'localhost';
global.SolrHost = 'localhost:8080/solr';
global.RecommendHost = 'localhost';

global.huanxinOption = {
    grant_type: "client_credentials",
    client_id: "YXA60WgpwK3oEeSSepUqUDAw-g",
    client_secret: "YXA6FFuLRmtnIrqWT62PPvnNmtkytFQ"
};
global.huanxinEnv = '66xiaoqudev';


/**
 * 测试环境
 */
//global.RabbitMqHostIp = 'localhost';
////global.MemCacheHostIp = 'localhost';
//global.RedisHostIp = 'localhost';
////global.MySQLHostIp = 'localhost';
//global.MongoDBHostIp = 'localhost';
//global.FastDfsHostIp = 'localhost';
//global.SolrHost = 'localhost:8080/solr';
//global.RecommendHost = 'localhost';

//global.huanxinOption = {
//    grant_type: "client_credentials",
//    client_id: "YXA6hH0x4K3pEeScHsvob9qH-g",
//    client_secret: "YXA6LsjjTUWeGDDZru5GiiFtxnM9DA4"
//};
//global.huanxinEnv = '66xiaoqup';


/**
 *生产环境
 */
//global.RabbitMqHostIp = '192.168.0.7';
////global.MemCacheHostIp = 'localhost';
//global.RedisHostIp = '192.168.0.7';
////global.MySQLHostIp = 'localhost';
//global.MongoDBHostIp = '192.168.0.7';
//global.FastDfsHostIp = '192.168.0.2';
//global.SolrHost = '192.168.0.8:8080/solr';
//global.RecommendHost = '192.168.0.7';

//global.huanxinOption = {
//    grant_type: "client_credentials",
//    client_id: "YXA64d6HcMSmEeS9lcFg-3bCFw",
//    client_secret: "YXA6HDLR3rY5_gKJvredBWjeQzpbVo8"
//};
//global.huanxinEnv = '66xiaoquprod';


//短信平台帐号密码
global.spid = '6297';
global.sppassword = 'nbh6297';


/**
 * 获取IP地址
 */

function getIPAddresses() {
    var ipAddresses = [];
    var interfaces = require('os').networkInterfaces();
    for (var devName in interfaces) {
        var iface = interfaces[devName];
        for (var i = 0; i < iface.length; i++) {
            var alias = iface[i];
            if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal) {
                ipAddresses.push(alias.address);
            }
        }
    }
    return ipAddresses;
}

/**
 * baiduPushClient
 */
 global.baiduOpt = {
    ak: 'BcHk96W38zsw9c3zkpyF8nA6',
    sk: 'rWuMTwGrEoOOyfC6M6S8A3Gghf6fy9Dv'

};






